package org.ajax.entity;

import java.util.Date;

/*
 *
 *@author XCH
 *@date2024 - 11 - 20
 *
 */
public class Commodity {
    private int id;
    private String name;
    private double price;
    private Date date;
    private int status;

    // 无参构造器
    public Commodity() {
    }

    // 有参构造器
    public Commodity(int id, String name, double price, Date date, int status) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.date = date;
        this.status = status;
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {  // 注意：方法名应与字段名匹配
        this.date = date;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Commodity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", date=" + date +
                ", status=" + status +
                '}';
    }
}
